<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    	<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/public.css" />
		<link rel="stylesheet" href="../css/fund.css">
		<style type="text/css">
			*{-webkit-text-size-adjust:none;}
			.mui-bar-nav~.per-content .mui-slider.mui-fullscreen {
			    top: 44px;
			}
			.cs_table_list_item{padding: 0 10px;font-size: 12px;color: #7d7d7d;}
			.cs_sm_txt{font-size: 8px;}
			.cs_ov_hide{overflow: hidden !important;}
		</style>
		<title>公司排名</title>
	</head>
	<body>
		<header id="header" class="mui-bar mui-bar-nav jjs-header">
			<h2 class="mui-title">公司排名</h2>
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left header-left-result"></a>
			<a class="mui-icon mui-icon-bars mui-pull-right header-right"></a>
		</header>
		<div class="mui-content fund-net company_rank_content per-content">
			
			<div id="slider" class="mui-slider mui-fullscreen cs_ov_hide">
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll">
						<a class="mui-control-item mui-active" href="#item11">股票型</a>
						<a class="mui-control-item" href="#">指数型</a>
						<a class="mui-control-item" href="#">混合型</a>
						<a class="mui-control-item" href="#">保本型</a>
						<a class="mui-control-item" href="#">债券型</a>
						<a class="mui-control-item" href="#">QDII</a>
					</div>
				</div>
				<div class="mui-slider-group">
					<div id="item11" class="mui-slider-item mui-control-content mui-active">
						<div id="scroll1" class="mui-scroll-wrapper">
							<div class="mui-scroll">
								<div class="cs_table_title flex-box t_cen">
									<div class="flex-2">排名</div>
									<div class="flex-3">代码</div>
									<div class="flex-4">基金公司</div>
									<div class="flex-5 cs_listorder_btn t_hide" data-order="" data-type='desc' onclick="listOrderByType('qujian2',this)">管理规模<span class="cs_sm_txt">(亿元)</span></div>
									<div class="flex-4 cs_listorder_btn" data-order="" data-type='desc' onclick="listOrderByType('qujian2',this)">成立时间</div>
									<div class="flex-3 cs_listorder_btn" data-order="" data-type='desc' onclick="listOrderByType('qujian2',this)">基金数</div>
									<div class="flex-3 cs_listorder_btn" data-order="" data-type='desc' onclick="listOrderByType('qujian2',this)">经理数</div>
								</div>	
									
								<ul class="mui-table-view table-list table-list" id="refreshContainer">
								    <li class="mui-table-view-cell">
								        <a class="" href="#">
								        	<div class="flex-box t_cen cs_table_list_item">
								        		<div class="flex-2 t_cen">1</div>
								        		<div class="flex-3">123456</div>
								        		<div class="flex-4 t_left t_hide t_indent20">光大天大</div>
								        		<div class="flex-5">325.10</div>
								        		<div class="flex-4">2011-10</div>
								        		<div class="flex-3">16</div>
								        		<div class="flex-3">5</div>
								        	</div>
								        </a>
								        
								    </li>
								    <li class="mui-table-view-cell">
								        <a class="" href="#">
								        	<div class="flex-box t_cen cs_table_list_item">
								        		<div class="flex-2 t_cen">1</div>
								        		<div class="flex-3">123456</div>
								        		<div class="flex-4 t_left t_hide t_indent20">光大天大</div>
								        		<div class="flex-5">325.10</div>
								        		<div class="flex-4">2011-10</div>
								        		<div class="flex-3">16</div>
								        		<div class="flex-3">5</div>
								        	</div>
								        </a>
								    </li>
								</ul>
							</div>
						</div>
						<form action="" class="jump"> 
							<label for="">
								<input type="text" />页<span><i>1</i>/382</span>
							</label>
							<button type="button">跳转</button>
						</form>
					</div>
				</div>
			</div>
		</div>
		
	<script src="../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/public.js" type="text/javascript" charset="utf-8"></script>
	
	<script type="text/javascript">
	var parameter = false;
    // a标签跳转bug
    mui('body').on('tap','a',function(){document.location.href=this.href;});
    // 排序点击不响应bug
    $('.cs_table_title').on('tap','.cs_listorder_btn',function(){
        this.click();
    });

    mui.init({
        swipeBack : false,//侧滑返回组件
        pullRefresh : {

            container : '#scroll1', //一个功能的一部分
            down : {
                callback : pulldownRefresh,//callback事件回调冒号后面就是方法
                height : 50,
                auto : false,
                contentdown : "下拉可以刷新",
            },
            // up:{
            //     callback:pullupload,
            // }

        }
    });

    $(function(){
        pulldownRefresh();
    })

    // 下拉刷新
    function pulldownRefresh() {

        var datas = {
            msg:'fuck'
        }
        if(parameter){
            datas.parameter=parameter;
            datas.order = order;
        }
        $.ajax({
            url:'{:U("xxxxx")}',
            dataType:'json',
            type:'post',
            data:datas,
            success:function(data){
                // console.log(ret)
                if(data.status==1){
                    var html = '';
                    $.each(data.info,function(k,v){
//                      var x = parseInt(k)+1;
//                      var jjid = v.jjid ? v.jjid :'--';
//                      var jiancheng = v.jiancheng ? v.jiancheng :'--';
//                      var qujian2 = v.qujian2 ? v.qujian2 :'--';
//                      var name = v.name ? v.name :'--';
//                      var danwei = v.danwei ? v.danwei :'--';

                        html+='<li class="mui-table-view-cell">'
							+'        <a class="" href="#">'
							+'        	<div class="flex-box t_cen cs_table_list_item">'
							+'        		<div class="flex-2 t_cen">1</div>'
							+'        		<div class="flex-3">123456</div>'
							+'        		<div class="flex-4 t_left t_hide t_indent20">光大天大</div>'
							+'        		<div class="flex-5">325.10</div>'
							+'        		<div class="flex-4">2011-10</div>'
							+'        		<div class="flex-3">16</div>'
							+'        		<div class="flex-3">5</div>'
							+'        	</div>'
							+'        </a>'
							+'    </li>'
                        
                    });
                    $(".table-list").html(html);
                    mui('#scroll1').pullRefresh().endPulldownToRefresh(); //用来停止刷新
                }else{
                    mui.alert(data.info);
                    return false;
                }

            }

        })

    }



	function gotopage (){
        var pages = $('#pagesNum').val();
        if($.trim(pages)==''|| isNaN(pages)){
         return   mui.alert('请输入页数数字！');
        }
        var total = 10;
        var datas = {
            type:$('#type').val(),
            page:pages,
            total:total,
        };
        if(parameter){
            datas.parameter=parameter;
            datas.order = order;
        }
        $.ajax({
            url:'xxx',
            dataType:'json',
            type:'post',
            data:datas,
            success:function(data){
                // console.log(ret)
                if(data.status==1){
                    var html = '';
                    $.each(data.info,function(k,v){
//                      var codes = v.jjid ? v.jjid :'--';
//                      var nick = v.jiancheng ?v.jiancheng :'--';
//                      var unitValue = v.danwei ? v.danwei :'--';
//                      var totalValue = v.leiji ? v.leiji :'--';
//                      var oneYear = v.qujian ? v.qujian : '--';
                        if(k!='page'){
                            html+='<li class="mui-table-view-cell">'
								+'        <a class="" href="#">'
								+'        	<div class="flex-box t_cen cs_table_list_item">'
								+'        		<div class="flex-2 t_cen">1</div>'
								+'        		<div class="flex-3">123456</div>'
								+'        		<div class="flex-4 t_left t_hide t_indent20">光大天大</div>'
								+'        		<div class="flex-5">325.10</div>'
								+'        		<div class="flex-4">2011-10</div>'
								+'        		<div class="flex-3">16</div>'
								+'        		<div class="flex-3">5</div>'
								+'        	</div>'
								+'        </a>'
								+'    </li>'
                        }
                    });
                    var res ='<input id="pagesNum" type="text" />页<span><i>'+data.info.page+'</i>/{$mobile_count}</span>';
                    $('.pagenumber').html(res);
                    $(".table-list").html(html);
                }else{
                    mui.alert(data.info);
                    return false;
                }

            },
        })
    }
    
    
    // 排序方法
    function listOrderByType(type,e){
        parameter = type;
        order = $(e).data('order');
        if(order ==''){
            console.log(order);
            order = 'desc';
            $(e).addClass('desc').removeClass('asc').siblings().removeClass('asc desc');
            $(e).data('order','desc');
            pulldownRefresh();
        }else{
            if(order =='asc'){
            order='desc';
            $(e).addClass('desc').removeClass('asc').siblings().removeClass('asc desc');
            $(e).data('order','desc');
            pulldownRefresh();
            }else{
               order='asc';
               $(e).addClass('asc').removeClass('desc').siblings().removeClass('asc desc');
               $(e).data('order','asc');
               pulldownRefresh();
            }
        }
        
    } 
		</script>
	</body>
</html>
